<template>
	<view class="content">
		<uni-list border-full>
			<uni-list-item v-for="(item,index) in listarr" @click="gotodetail(item)" :title="item.card_name" :note="item.shop_name" link />
		</uni-list>
					
		<!-- <view class="weui-cells">
			<view class="weui-cell" v-for="(item,index) in listarr" @click="gotodetail(item)">
				<view class="weui-cell__hd">
					<label class="weui-label">{{item.card_name}}</label>
					<view class="weui-cell__desc">{{item.shop_name}}</view>
				</view>
				<view class="weui-cell__bd"></view>
				<view class="weui-cell__ft"><i class="icon-right"></i></view>
			</view>
		</view> -->
	</view>
</template>

<script>
	import {usermy_card} from "@/api/apiinfo";
	import {timestampToTemplatethoer} from "@/utils/validate.js"
	export default {
				components: {},
				data() {
					return {
						status: 'more',//more/loading/noMore
						
						// statusTypes: [{
						// 	value: 'more',
						// 	text: '加载前',
						// 	checked: true
						// }, {
						// 	value: 'loading',
						// 	text: '加载中',
						// 	checked: false
						// }, {
						// 	value: 'noMore',
						// 	text: '没有更多',
						// 	checked: false
						// }],
						
						
						toptitle:'',
						scrollTop: "50px",
						isLoadingTop: true,
						isTriggeredTop: true,
						typeid:1,
						pagenumber:1,
						listarr:[],//列表
						
						shop_id:0,
						dailyflowresdata:{} ,//获取到的所有数据
						getdate:'',
						datetemp:'',
						
					}
				},
				mounted() {
					// setTimeout(() => {
					// 	this.datetemp = timestampToTemplatethoer(Date.now());
					// },1000)
					// console.log(timestampToTemplate(Date.now()))
				},
				onLoad() {
					
					this.getusermy_card();
					
				},
				methods: {
					gotodetail(item){
						uni.navigateTo({ //内部页面跳转方式
							url: '/pages/shop/shop_detail?id='+item.shop_id
						})
					},
					newdate(times){//时间戳转换时间格式
						return timestampToTemplatethoer(times * 1000)
					},
					
					getusermy_card() { // 						
						usermy_card().then((res) => {
							console.log("usermy_card接口返回数据：")
							console.log(JSON.stringify(res));
							this.listarr = res.data.list
						}).catch(err => {
							console.log(JSON.stringify(err))
							if(err.msg){
								uni.showModal({
									title: '提示',
									content: '数据接口报错：'+err.msg,
									showCancel: false,
									success: function (res) {
										if (res.confirm) {
											// uni.switchTab({ //内部页面跳转方式 
											// 	url: '/pages/shop/shop'
											// })
										} 
									}
								});
							}
							
						})
					},
					
				}
			}
</script>


<style lang="scss">
	.content{
		position: relative;
		// .bg-radius{
		// 	border-radius: 30rpx;
		// 	box-sizing: border-box;
		// 	box-shadow: 0 0 30rpx rgba(0, 0, 0, .1);
		// 	color: #101010;
		// 	background-color: #fff;
		// }
	}
	page{
		background-color: #fff;
	}
</style>
